if (isNaN(value))
throw TypeError('The bar level value must be a number');
- this._value = Math.max(Math.min(value, this._maxValue), 0);
+ value = Math.max(Math.min(value, this._maxValue), 0);
+
+ if (this._value == value)
+ return;
+
+ this._value = value;
this.actor.queue_repaint();
}
if (isNaN(value))
throw TypeError('The bar level max value must be a number');
- this._maxValue = Math.max(value, 1);
+ value = Math.max(value, 1);
+
+ if (this._maxValue == value)
+ return;
+
+ this._maxValue = value;
this._overdriveStart = Math.min(this._overdriveStart, this._maxValue);
this.actor.queue_repaint();
}
set overdrive_start(value) {
if (isNaN(value))
throw TypeError('The overdrive limit value must be a number');
+
+ if (this._overdriveStart == value)
+ return;
+
if (value > this._maxValue)
throw new Error(`Tried to set overdrive value to ${value}, ` +
`which is a number greater than the maximum allowed value ${this._maxValue}`);